<!DOCTYPE html>
<html>
<head>
	<title>TASK 14</title>
	<meta charset="utf-8">
</head>
<body>
	<h3>污染城市列表</h3>
	<ul id="aqi-list"></ul>
	<script type="text/javascript">
	/*
	Get array.sort document.createElement node.appendChild
	*/
		var aqiData = [
		 ["北京",90],
		 ["上海",50],
		 ["福州",10],
		 ["广州",100],
		 ["长沙",70],
		 ["哈尔滨",71]
		];
		var list = document.getElementById('aqi-list');
		var rank = ['一','二','三','四','五'];
	
		aqiData.sort(function(a,b){
			return b[1]-a[1];
		});

		for (var i = 0; i < aqiData.length; i++) {
			if (aqiData[i][1]>60) {
				var li = document.createElement('li');
				li.innerHTML = "第"+rank[i]+"名，"+aqiData[i][1];
			}
			list.appendChild(li);
		}
		
	</script>

</body>
</html>